This function converts a date of data type DTL into a character string of data type STRING in American format (US) (MM DD YYYY…).
| LGF_DTLToString_US (FC) | ||||||||
|---|---|---|---|---|---|---|---|---|
| DTL | date | Ret_Val | String | |||||
| Char | separator | |||||||
| Char | separatorDateAndTime | |||||||
| Identifier | Data type | Description |
|---|---|---|
| date | DTL | Date to convert as DTL tag |
| separator | Char | Separator between the components of the output date. |
| separatorDateAndTime | Char | Separator between the components date and time. |
| Identifier | Data type | Description |
|---|---|---|
| Ret_Val | String | Output string in accordance with the American format (US). Example: `01-22-2019 14:06:51.524621000` |
The block reads a date of data type DTL and converts the individual components of the date (year, month, day, hour…) into a character string and outputs it in American format (US). The separator between the components of the date is variable.

At the input parameter separator, you specify the separator between the components of the date, at seperatorDateAndTime you specify the separator between the date and the time.
separatorDate = - - outString = 06-20-2025… (default)
separatorDate = / - outString = 06/20/2025…
separatorDateAndTime = - outString = 06-20-2025 12:45… (default)
separatorDateAndTime = T - outString = 06-20-2025T12:45…
| Version & Date | Change description | |
|---|---|---|
| 1.0.0 | Siemens Industry Online Support | |
| 28.07.2025 | First released version | |
| 1.0.1 | Simatic Systems Support | |
| 09.10.2025 | Spelling errors | |